<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex feedBackDetail_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-stretch justify-between feedBackDetail_fd0_0'>
					<view class='flex flex-wrap align-center feedBackDetail_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  feedBackDetail_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='feedBackDetail_fd0_0_c1_c0'>{{$t('历史反馈')}}</text>
					</view>
					<view class='flex align-center justify-end feedBackDetail_fd0_0_c2'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view class="loading_css" v-if="isShow">
				<u-loading size="36" color="#3090FF"></u-loading>
				<view>加载中</view>
			</view>
			<!---反馈记录带联系人flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout feedBackDetail_flex_1" v-else>
				<template v-for='(item,key0) in list'>
					<view class='flex flex-wrap align-start feedBackDetail_fd1_0' :key='key0'>
						<image class='feedBackDetail_fd1_0_c0' mode="aspectFit" :src='item.avatar'></image>
						<view class='flex flex-direction flex-wrap align-stretch flex-sub feedBackDetail_fd1_0_c1'>
							<view class='flex flex-direction flex-wrap align-stretch feedBackDetail_fd1_0_c1_c0'>
								<view class='flex-sub'>
									<text class='feedBackDetail_fd1_0_c1_c0_c0_c0'>{{item.body}}</text>
								</view>
							</view>
							<view class='flex flex-wrap align-center' v-if="item.thumb.length > 0">
								<template v-for='(child,key1) in item.thumb'>
									<view class='flex flex-wrap align-center feedBackDetail_fd1_0_c1_c1_c0' :key='key1'>
										<image class='feedBackDetail_fd1_0_c1_c1_c0_c0' mode="aspectFill" :src='child'
											@tap.stop="multiImagePreview(child,item.thumb,'')"></image>
									</view>
								</template>

							</view>
							<view class='flex flex-wrap align-center feedBackDetail_fd1_0_c1_c2'>
								<text class='feedBackDetail_fd1_0_c1_c2_c0'>{{$t('反馈类型：')}}</text>
								<text class='feedBackDetail_fd1_0_c1_c2_c0'>{{item.type}}</text>
							</view>
							<view class='flex flex-wrap align-center feedBackDetail_fd1_0_c1_c3'>
								<text class='feedBackDetail_fd1_0_c1_c2_c0'>{{$t('反馈时间：')}}</text>
								<text class='feedBackDetail_fd1_0_c1_c2_c0'>{{item.create_time}}</text>
							</view>
							<view class='flex flex-wrap align-center feedBackDetail_fd1_0_c1_c4'
								v-if="item.is_replay=='2'">
								<text class='feedBackDetail_fd1_0_c1_c4_c0'>{{$t('平台回复：')}}</text>
								<text class='feedBackDetail_fd1_0_c1_c4_c1'>{{item.replay}}</text>
							</view>
						</view>
					</view>
				</template>
				<view class="loadmore" v-if="last_page > 1">
					<u-loadmore font-size="24" :status="status" :icon-type="iconType" :load-text="loadText" />
				</view>
			</view>

			<!---反馈记录带联系人flex布局结束-->
			<view class="noData" v-if="list.length == 0 && !isShow">
				<image :src='STATIC_URL+"no.png"'></image>
			</view>

		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getList()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		// 下拉刷新
		onPullDownRefresh() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList();
		},
		// 上拉加载
		onReachBottom() {
			if (this.page >= this.last_page) return;
			this.status = 'loading';
			this.page++;
			setTimeout(() => {
		
				if (this.page >= this.last_page) this.status = 'nomore';
				else this.status = 'loading';
				this.is_pull = false;
				this.getList();
			}, 500)
		},
		onPageScroll(e) {

		},
		methods: {
			//用户管理-意见反馈记录
			getList() {
				this.$api.post(global.apiUrls.post641472eb35317, {
					page: this.page
				}).then(res => {
					// console.log(res);
					uni.stopPullDownRefresh();
					this.isShow = false;
					if (res.data.code == 1) {
						this.last_page = res.data.data.last_page;
						if (this.is_pull) {
							this.list = res.data.data.data;
						} else {
							this.list = this.list.concat(res.data.data.data);
						}
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.feedBackDetail_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.feedBackDetail_fd0_0_c2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
		width: 100rpx;
	}

	.feedBackDetail_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.feedBackDetail_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333;
	}

	.feedBackDetail_fd0_0_c0 {
		width: 100rpx;
	}

	.feedBackDetail_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.feedBackDetail_flex_1 {
		padding: 0rpx 24rpx 0rpx 24rpx;
	}

	.feedBackDetail_fd1_0_c1_c4_c1 {
		line-height: 46rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor0);
	}

	.feedBackDetail_fd1_0_c1_c4_c0 {
		line-height: 46rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor4);
	}

	.feedBackDetail_fd1_0_c1_c4 {
		background: rgba(248, 248, 248, 1);
		padding: 24rpx 16rpx 24rpx 16rpx;
		margin: 16rpx 0rpx 0rpx 16rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		background-size: 100% auto !important;
	}

	.feedBackDetail_fd1_0_c1_c3 {
		margin: 0rpx 0rpx 0rpx 16rpx;
	}

	.feedBackDetail_fd1_0_c1_c2_c0 {
		line-height: 33rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: var(--benbenFontColor2);
	}

	.feedBackDetail_fd1_0_c1_c2 {
		margin: 32rpx 0rpx 16rpx 16rpx;
	}

	.feedBackDetail_fd1_0_c1_c1_c0_c0 {
		width: 180rpx;
		height: 180rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.feedBackDetail_fd1_0_c1_c1_c0 {
		margin: 12rpx 5rpx 12rpx 5rpx;
	}

	.feedBackDetail_fd1_0_c1_c0_c0_c0 {
		line-height: 46rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor0);
		padding: 0rpx 30rpx 0rpx 0rpx;
	}

	.feedBackDetail_fd1_0_c1_c0 {
		position: relative;
		padding: 0rpx 0rpx 0rpx 16rpx;
	}

	.feedBackDetail_fd1_0_c1 {
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.feedBackDetail_fd1_0_c0 {
		width: 72rpx;
		height: 72rpx;
		border-radius: 50rpx 50rpx 50rpx 50rpx;
	}

	.feedBackDetail_fd1_0 {
		border-bottom: 1px solid #eee;
		padding: 24rpx 0rpx 32rpx 0rpx;
	}
</style>